/*
 * Main.cpp
 *
 *  Created on: Oct 10, 2013
 *      Author: Administrator
 */
#include <iostream>
using namespace std;
#include "Ex1.h"
#include "Ex1_2.h"
#include "Ex2.h"
#include "Test1.h"
#include "Ex9.h"
#include "Ex11.h"
#include "Ex13.h"
#include "Ex14.h"
#include "Ex28.h"


void runEx1();
void runEx1()
{
	Ex1 e1(1);
	cout << (e1++).getA()<<endl;
	cout << (++e1).getA()<< endl;
}

void runEx1_2();
void runEx1_2()
{
	Ex1_2 e1(1);
	cout << (e1++).getA()<<endl;
	cout << (++e1).getA()<< endl;
}

void runEx2();
void runEx2()
{
	Ex2 a1(2);
	Ex2 a2(3);
	(a1+a2).print(cout);
	(a1-a2).print(cout);
}

void runEx3();
void runEx3(){
	Ex2 a1(2);
	Ex2 a2(3);
	Ex2 a3(4);
	(a1+a2-a3).print(cout);

}

void runEx4();
void runEx4()
{
	Ex2 a(4);
	(a--).print(cout);
	(--a).print(cout);
}

void test1();
void test1()
{
	Test1 t1(1);
	Test1 t2 = (++t1);
}

void runEx9();
void runEx9()
{
	Ex9 e('a');
	cout << e ;
	cin >> e;
	cout << e ;
}

void runEx11();
void runEx11()
{
	Ex11 a(3.0);
	Ex11 b(6.0);
	(a+b).print();
	double c = a;
	cout << c <<endl;
}

void runEx13()
{
	double a= 2.1;
	Ex13 d1(&a);
	double b = 3.3;
	Ex13 d2(&b);
	d1.print();
	d2.print();
	d1 =d2;
	d1.print();
	d2.print();
}

void runEx14()
{
	Ex14 t1("abc");
	Ex14 t2("bcd");
	t1.print(cout);
	t2.print(cout);
}

void runEx28()
{
	Apple a1(1);
	Orange a2(2);
	//Orange a3 = a1; this does not work, since Apple does not have a automatic converting operator
	//overloaded.
	Apple a4 = a2;
}

int main()
{
	//runEx1();
	//runEx1_2();
	//runEx2();
	//runEx3();
	//runEx4();
	//test1();
	///runEx9();
	//runEx11();
	//runEx13();
	//runEx14();
	runEx28();
	return 1;
}



